import { User } from '../entities/user.entity';
import { UserAction } from 'src/user-action/entities/user-action.entity';
import { Article } from 'src/article/entities/article.entity';
import { ArticleLike } from 'src/article-like/entities/article-like.entity';
import { ArticleView } from 'src/article-view/entities/article-view.entity';
import { Comment } from 'src/comment/entities/comment.entity';
import { Type } from 'class-transformer';

export class GetUserInfoDto extends User {
  @Type(() => Article)
  articles: Article[];
  @Type(() => ArticleViewWithArticleDto)
  views: ArticleViewWithArticleDto[];
  @Type(() => ArticleLikeWithArticleDto)
  likes: ArticleLikeWithArticleDto[];
  actions: UserAction[];
  @Type(() => CommentWithArticleDto)
  comments: CommentWithArticleDto[];
}

export class ArticleViewWithArticleDto extends ArticleView {
  @Type(() => Article)
  article: Article;
}
export class ArticleLikeWithArticleDto extends ArticleLike {
  @Type(() => Article)
  article: Article;
}
export class CommentWithArticleDto extends Comment {
  @Type(() => Article)
  article: Article;
}
